home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-08 | 10.7 KB | 450 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- File: PictureViewer.r
-
- Contains: PictureViewer Resources
-
- Written by: Sue Dumont
-
- Copyright: © 1994-95 by Apple Computer, Inc., all rights reserved.
- ------------------------------------------------------------------------------*/
-
- #define SystemSevenOrBetter 1 // we want the extended types
- #define SystemSevenOrLater 1 // Types.r uses this variable
-
- #include "Types.r"
- #include "SysTypes.r"
- #include "CodeFragmentTypes.r"
-
- #ifndef __ODTYPES_R__
- #include "ODTypes.r"
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdDefs_defined
- #include "StdDefs.r"
- #endif
-
- #ifndef _PICTUREVIEWERDEF_
- #include "PictureViewerDef.h"
- #endif
-
- #ifndef _PICTUREVIEWERVERS_
- #include "PictureViewerVers.h"
- #endif
-
- //-------------------------------------------------------------------------------------
- // .rsrc resources
- //-------------------------------------------------------------------------------------
-
- // This file accesses the resources from my .rsrc file (PICTs etc.)
- include "PictureViewerOther.rsrc";
-
- //-------------------------------------------------------------------------------------
- // Finder Version Resources
- //-------------------------------------------------------------------------------------
-
- // Part's Finder Version Resource
-
- resource 'vers' (1) {
- currentMajorVersion,
- finderMinorVersion,
- developmentStage,
- preReleaseNumber,
- verUS,
- shortVersionStr,
- shortVersionStr", © Apple Computer, Inc. 1994-1995"
- };
-
- resource 'vers' (2) {
- currentMajorVersion,
- finderMinorVersion,
- developmentStage,
- preReleaseNumber,
- verUS,
- shortVersionStr,
- "OpenDoc™ Sample Code"
- };
-
- //-------------------------------------------------------------------------------------
- // Code Fragment Resource
- //-------------------------------------------------------------------------------------
-
- resource 'cfrg' (0) {
- { /* [1] */
- #ifdef _68KBUILD_
- kMotorola,
- #else
- kPowerPC,
- #endif
- kFullLib,
- currentVersion,
- compatibleVersion,
- kDefaultStackSize,
- kNoAppSubFolder,
- kIsLib,
- kOnDiskFlat,
- kZeroOffset,
- kWholeFork,
- kPictureViewerID, /* this must be the class ID */
- /* [2] */
- #ifdef _68KBUILD_
- kMotorola,
- #else
- kPowerPC,
- #endif
- kFullLib,
- currentVersion,
- compatibleVersion,
- kDefaultStackSize,
- kNoAppSubFolder,
- kIsLib,
- kOnDiskFlat,
- kZeroOffset,
- kWholeFork,
- kPartClassName /* this must be the part class name */
- }
- };
-
-
- //-------------------------------------------------------------------------------------
- // NMAP Resources
- //-------------------------------------------------------------------------------------
-
- // Map a part's class id (module::classname)
- // to the part editor's name
- //
- resource kODNameMappings (kEditorUserStringMapId, "Class ID->Editor Name") {
- kODEditorUserString,
- { /* array Types: 1 elements */
- /* [1] */
- kPictureViewerID,
- kODIsINTLText
- {
- smRoman,
- langEnglish,
- kPictureViewerEditorString
- }
- }
- };
-
-
- // Map a part's class id (module::classname) to
- // the data/file OSTypes the part supports.
- //
- resource kODNameMappings (kPlatformEditorKindMapId, "Class ID->MacOSType") {
- kODEditorPlatformKind,
- { /* array KeyList: 1 elements */
- /* [1] */
- kPictureViewerID,
- kODIsPltfmTypeSpac {
- /* array PltfmTypeSpacList: 2 elements */
- {
- /* [1] */
- kODPlatformFileType,
- kPictureDataType,
- smRoman,
- langEnglish,
- kPictureFileKindUserString,
- kODCategoryDrawing,
- /* [2] */
- kODPlatformDataType,
- kPictureDataType,
- smRoman,
- langEnglish,
- kPictureDataKindUserString,
- kODCategoryDrawing
- }
- }
- }
- };
-
-
- // Let OpenDoc know that this part is only a viewer. When data
- // is bound to a part editor/viewer, OpenDoc will bind to an
- // editor over a viewer.
- //
- resource kODNameMappings (kViewerMapId) {
- kODViewer,
- { /* array: 1 elements */
- kPictureViewerID,
- kODIsAnISOString {
- kODSimpleViewer
- }
- }
- };
-
-
- //-------------------------------------------------------------------------------------
- // String List Resources
- //-------------------------------------------------------------------------------------
-
- resource 'STR#' (kMenuStringResID, "Menu Items strings") {
- { /* array StringArray: 1 element */
- /* [1] */
- "About PictureViewer…",
- /* [2] */
- "Display",
- /* [3] */
- "Crop to frame",
- /* [4] */
- "Scale to frame"
- }
- };
-
- resource 'STR#' (kErrorStringResID, "Error strings") {
- { /* array StringArray: 4 elements */
- /* [1] */
- "“PictureViewer” was unable to completely"
- " initialize its internal structures.",
- /* [2] */
- "“PictureViewer” was unable to open the d"
- "ocument due to unforseen circumstances.",
- /* [3] */
- "“PictureViewer” was unable to open a par"
- "t window due to unforseen circumstances.",
- /* [4] */
- "“PictureViewer” has been asked to remove"
- " a frame that does not belong to it, or "
- "an error occurred while removing the fra"
- "me from internal storage.",
- /* [5] */
- "A window that “PictureViewer” created ha"
- "s been deleted without its knowledge. Th"
- "is may generate a fatal error in the nea"
- "r future. Please close the document imme"
- "diately to prevent data loss.",
- /* [6] */
- "“PictureViewer” encountered a fatal erro"
- "r while trying to save. Try saving again"
- " or closing the document."
- }
- };
-
- //-------------------------------------------------------------------------------------
- // Finder Related Resources
- //-------------------------------------------------------------------------------------
-
- // Kind resources affect the text Finder displays in the
- // "kind" column and file info dialog. This feature was
- // introduced as part of Macintosh Easy Open.
- //
- resource 'kind' (kBaseResourceID+1) {
- kPictureViewerViewerOSType,
- 0, /* region = USA */
- {
- 'shlb', "OpenDoc™ viewer"
- }
- };
-
- resource 'kind' (kBaseResourceID+2) {
- kODShellSignature,
- 0, /* region = USA */
- {
- kPictureViewerDocumentOSType, "PictureViewer 1.0 document",
- kPictureViewerStationeryOSType, "PictureViewer 1.0 stationery"
- }
- };
-
- // The -16397 string will be displayed by Finder when a user
- // tries to open the editor shared library. The string should
- // give the user a little detail about the part's capabilities
- // and enough information to install the part in the correct location.
- //
- resource 'STR ' (-16397, purgeable) {
- "OpenDoc™ viewer\n\n“PictueViewer” demonstrates the functionality of a bas"
- "ic viewer. To work properly, it should be placed in the Editors folder."
- };
-
- //-------------------------------------------------------------------------------------
- // Dialog Resources
- //-------------------------------------------------------------------------------------
-
- resource 'DLOG' (kAboutBoxID, "PictureViewer About Box") {
- {0, 0, 250, 350},
- dBoxProc,
- invisible,
- goAway,
- 0x0,
- kAboutBoxID,
- "",
- alertPositionMainScreen
- };
-
- resource 'DITL' (kAboutBoxID) {
- { /* array DITLarray: 8 elements */
- /* [1] */
- {222, 270, 242, 338}, Button { enabled, "OK" },
- /* [2] */
- {24, 25, 56, 57}, Picture { disabled, kViewerIcons },
- /* [3] */
- {13, 68, 237, 69}, Button { disabled, "" },
- /* [4] */
- {64, 13, 65, 337}, Button { disabled, "" },
- /* [5] */
- {46, 76, 62, 172}, StaticText { disabled, "PictureViewer" },
- /* [6] */
- {76, 76, 106, 304}, StaticText { disabled,
- "PictureViewer is a sample part viewer th"
- "at displays Macintosh™ PICT data.xxxxxxx"},
- /* [7] */
- {116, 76, 144, 304}, StaticText { disabled,
- "Written by Sue Dumont, with support from"
- " the OpenDoc™ Engineering team." },
- /* [8] */
- {160, 76, 188, 300}, StaticText { disabled,
- "Copyright© 1994,1995 by Apple Computer, "
- "Inc. All Rights Reserved." },
- /* [9] */
- {51, 272, 64, 340}, StaticText { disabled,
- "Version "shortVersionStr }
- }
- };
-
- resource 'dctb' (kAboutBoxID) {
- /* dialog background fill color */
- { /* array ColorSpec: 5 elements */
- /* [1] */
- wContentColor, 59127, 59127, 59127,
- /* [2] */
- wFrameColor, 0, 0, 0,
- /* [3] */
- wTextColor, 0, 0, 0,
- /* [4] */
- wHiliteColor, 0, 0, 0,
- /* [5] */
- wTitleBarColor, 65535, 65535, 65535
- }
- };
-
- data 'ictb' (kAboutBoxID) {
- /* dialog control text styling */
- $"0000000000000000002800240028"
- $"004C80070074800700888007009C"
- $"800700B0800700C4000000000000"
- $"000300007FFF7FFF7FFF0001FFFF"
- $"FFFFFFFF00020000000000000003"
- $"FFFFFFFFFFFF0000000000000003"
- $"00007FFF7FFF7FFF0001FFFFFFFF"
- $"FFFF00020000000000000003FFFF"
- $"FFFFFFFF00D80100000E00000000"
- $"0000FFFFFFFFFFFF000000E10000"
- $"0009000000000000FFFFFFFFFFFF"
- $"000000E800000009000000000000"
- $"FFFFFFFFFFFF000000EF00000009"
- $"000000000000FFFFFFFFFFFF0000"
- $"00F600000009000000000000FFFF"
- $"FFFFFFFF00000850616C6174696E"
- $"6F0647656E6576610647656E6576"
- $"610647656E6576610647656E6576"
- $"61"
- };
-
- resource 'DLOG' (kErrorBoxID, "PictureViewr Error Box") {
- {57, 46, 244, 374},
- dBoxProc,
- invisible,
- goAway,
- 0x0,
- kErrorBoxID,
- "",
- alertPositionParentWindowScreen
- };
-
- resource 'DITL' (kErrorBoxID) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {153, 256, 173, 314}, Button { enabled, "OK" },
- /* [2] */
- {153, 185, 173, 243}, Button { enabled, "Cancel" },
- /* [3] */
- {11, 70, 124, 317}, StaticText { disabled,
- "<< Use this for errors in the Editor, su"
- "ch as out of memory, unable to acquire s"
- "ome system resource, etc.>> \nUser errors"
- " use a standard alert appearance. See DI"
- "TL 129.>>" },
- /* [4] */
- {11, 19, 43, 51}, Picture { disabled, kViewerIcons },
- /* [5] */
- {149, 252, 177, 318}, UserItem { disabled }
- }
- };
-
- //-------------------------------------------------------------------------------------
- // Menu and items
- //-------------------------------------------------------------------------------------
-
- resource 'MENU' (kMenuStringResID) {
- kMenuStringResID,
- textMenuProc,
- allEnabled,
- enabled,
- "Display",
- { /* array: 2 elements */
- /* [1] */
- "Crop to frame", noIcon, noKey, check, plain,
- /* [2] */
- "Scale to frame", noIcon, noKey, noMark, plain
- }
- };
-
- //-------------------------------------------------------------------------------------
- // Finder Bundle Information
- //-------------------------------------------------------------------------------------
-
- resource 'BNDL' (kDocumentBundle, "Document BNDL") {
- kODShellSignature,
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 1 element */
- 0, kDocumentFREF
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 1 element */
- 0, kDocumentIcons
- }
- }
- };
-
- resource 'BNDL' (kViewerBundle, "Viewer BNDL") {
- kPictureViewerViewerOSType,
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, kViewerFREF
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, kViewerIcons
- }
- }
- };
-
-
- resource 'FREF' (kDocumentFREF) {
- kPictureViewerDocumentOSType,
- 0,
- ""
- };
-
- resource 'FREF' (kViewerFREF) {
- 'shlb',
- 0,
- ""
- };
-
- data kODShellSignature (0, "Owner resource") {
- $"00"
- };
-
- data kPictureViewerViewerOSType (0, "Owner resource") {
- $"00"
- };
-